﻿@{
	ViewBag.Title = @Resources.Menu_Submission;
}
<table cellpadding="0" cellspacing="0" border="0" width="100%" height="100%">
	<tr>
		<td class="b1">
			<div>
				<p><img src="~/images/icon_06.png" align="absmiddle" />&nbsp;@Resources.Menu_UserCenter<span>&nbsp;>>&nbsp;</span>@Resources.Menu_Submission
			</div>
		</td>
	</tr>
	<tr>
		<td class="b4">
			<div class="c">
				<div class="right" id="mainFrame">
					<div class="right_cont">
						<div id="dataGrid"></div>
						<div id="toolBar">
							<div id="searchBar">
								<div style="float: left; display: inline; padding: 5px 5px; font-weight: bold; text-align: left;">
									@Resources.ConferenceName：<input id="queryConferenceName" name="queryConferenceName" class="easyui-textbox" style="height:27px; width:200px;">&nbsp;&nbsp;
									@Resources.EssayTitle：<input id="queryEssayTitle" name="queryEssayTitle" class="easyui-textbox" style="height:27px; width:200px;">&nbsp;&nbsp;
									<a class="easyui-linkbutton" iconcls="icon-search" onclick="searchData()">@Resources.Search </a>
								</div>
							</div>
							<div id="menuBar"></div>
							<div class="clear"></div>
						</div>
					</div>
				</div>
			</div>
		</td>
	</tr>
</table>
<!-- 修改画面 start -->
<div id="detailWindow" class="easyui-window"
	title="@Resources.ConferenceContributeInfo" data-options="closed:true,minimizable:false,maximizable:false,iconCls:'icon-save'"
	style="width:1200px; display:none;">
	<div class="main">
		<div class="box clearfix">
			<h3 id="detailWindowTitle" class="tit01">@Resources.Modify</h3>
			<div class="formDiv">
				<form id="frmForm" method="post" enctype="multipart/form-data">
					@Html.AntiForgeryToken()
					<span id="ctnForm"></span>
					<input type="hidden" id="hidConferenceId" name="conferenceId" />
					<input type="hidden" id="hidIsNormal" />
					<input type="hidden" id="hidProgramAbstract" />
					<input type="hidden" id="hidAbstract" />
					<input type="hidden" id="hContributeId" name="ContributeId" />
				</form>
			</div>
			<div class="btnDiv" style="margin-top:20px">
				<input type="button" class="gbtn" onclick="saveData();" value="@Resources.Submit" />&nbsp;&nbsp;
				<input type="button" class="rbtn" onclick="$('#detailWindow').window('close');" value="@Resources.Cancel" />
			</div>
		</div>
	</div>
</div>
<!-- 修改画面 end -->
<!-- 稿件查看画面 start -->
<div id="lookupReview" class="easyui-window"
	title="@Resources.CheckProfileContributeInfo" data-options="closed:true,minimizable:false,iconCls:'icon-save'"
	style="width:1200px; display:none;">
	<div class="main">
		<div class="box clearfix">
			<h3 id="finalTrialTitle" class="tit01">@Resources.Lookup</h3>
			<form id="lookupJudge" method="post">
				@Html.AntiForgeryToken()
				<table width="100%" height="100%" id="tblDetail" cellpadding="0" cellspacing="1" border="0" class="tastyle01">
					<tr>
						<td style="text-align: right;" class="w1 c1">@Resources.ContributionID：</td>
						<td style="text-align: left;" class="w10 c2">
							<span id="l-contributionId"></span>
							<input type="hidden" id="l-hidID" name="Id" />
							<input type="hidden" id="l-hidConferenceId" name="conferenceId" />
							<input type="hidden" id="l-contributeId" name="contributeId" />
						</td>
					</tr>
					<tr>
						<td style="text-align: right;" class="w1 c3">@Resources.EssayTitle：</td>
						<td style="text-align: left;" class="w10 c4">
							<span id="l-title"></span>
						</td>
					</tr>
					<tr>
						<td style="text-align: right;" class="w1 c1">@Resources.Author：</td>
						<td style="text-align: left;" class="w10 c2">
							<span id="l-author"></span>
						</td>
					</tr>
					<tr>
						<td style="text-align: right;" class="w1 c3">@Resources.Affiliation：</td>
						<td style="text-align: left;" class="w10 c4">
							<span id="l-affiliation"></span>
						</td>
					</tr>
					<tr>
						<td style="text-align: right;" class="w1 c1">@Resources.Abstract：</td>
						<td style="text-align: left;" class="w10 c2">
							<span id="l-abstract"></span>
						</td>
					</tr>
					<tr>
						<td style="text-align: right;" class="w1 c3">@Resources.Keyword：</td>
						<td style="text-align: left;" class="w10 c4">
							<span id="l-keyword"></span>
						</td>
					</tr>
					<tr>
						<td style="text-align: right;" class="w1 c1">@Resources.TopicName：</td>
						<td style="text-align: left;" class="w10 c2">
							<span id="l-topicName"></span>
						</td>
					</tr>
					<tr>
						<td style="text-align: right;" class="w1 c3">@Resources.EssayType：</td>
						<td style="text-align: left;" class="w10 c4">
							<span id="l-essayTypeName"></span>
						</td>
					</tr>
					<tr>
						<td style="text-align: right;" class="w1 c1">@Resources.ReportType：</td>
						<td style="text-align: left;" class="w10 c2">
							<span id="l-reportType"></span>
						</td>
					</tr>
					<tr>
						<td style="text-align: right;" class="w1 c3">@Resources.ProgramAbstract：</td>
						<td style="text-align: left;" class="w10 c4">
							<span id="l-programAbstract"></span>
						</td>
					</tr>
					<tr>
						<td style="text-align: right;" class="w1 c1">@Resources.AbstractFile：</td>
						<td style="text-align: left;" class="w10 c2">
							<span id="l-abstractFile"></span>
						</td>
					</tr>
					<tr>
						<td style="text-align: right;" class="w1 c3">@Resources.SupplementaryFile：</td>
						<td style="text-align: left;" class="w10 c4">
							<span id="l-supplementaryFile"></span>
						</td>
					</tr>
					<tr>
						<td style="text-align: right;" class="w1 c1">@Resources.Awards</td>
						<td style="text-align: left;" class="w10 c2">
							<span id="l-awards"></span>
						</td>
					</tr>
					<tr>
						<td style="text-align: right;" class="w1 c3">@Resources.Remark：</td>
						<td style="text-align: left;" class="w10 c4">
							<span id="l-remark"></span>
						</td>
					</tr>
				</table>
				<h3 class="tit01">@Resources.ReviewResult</h3>
				<div id="l-review_result" style="width:100%"></div>
				<table width="100%" height="100%" id="tblDetail" cellpadding="0" cellspacing="1" border="0" class="tastyle01">
					<tbody id="l-finalRemark"></tbody>
				</table>
			</form>
			<div class="btnDiv">
				<input type="hidden" id="l-hdnWindowType" />
				<input type="button" class="rbtn" onclick="$('#lookupReview').window('close');" value="@Resources.Close" />
			</div>
		</div>
	</div>
</div>
<!-- 稿件查看画面 end -->
<!-- 作者画面 start -->
<div id="authorWindow" class="easyui-window"
	title="@Resources.Author" data-options="closed:true,minimizable:false,maximizable:false,iconCls:'icon-save'"
	style="width:1200px; display:none;">
	<div class="main">
		<div class="box clearfix">
			<h3 id="authorWindowTitle" class="tit01">@Resources.Modify</h3>
			<form id="frmAuthor" method="post">
				@Html.AntiForgeryToken()
				<div id="authorDG"></div>
				<table width="100%" height="100%" id="tblAuthor" cellpadding="0" cellspacing="1" border="0" class="tastyle01">
					<tr>
						<td style="text-align: right;" class="w1 c1">@Resources.FamilyName：</td>
						<td style="text-align: left;" class="w2 c2">
							<input type="hidden" id="hidAuthorId" name="Id" />
							<input type="hidden" id="hidAuthorConferenceId" name="ConferenceId" />
							<input type="hidden" id="hidContributeId" name="ContributeId" />
							<input type="hidden" id="hidConferenceLanguage" name="conferenceLanguage" />
							<input id="txtFamilyName" name="FamilyName" class="easyui-textbox" style="height:27px; width:300px;" data-options="prompt:'@Resources.FamilyNamePrompt',required:true, validType:['length[1,100]']">
						</td>
						<td style="text-align: right;" class="w1 c1">@Resources.FirstName：</td>
						<td style="text-align: left;" class="w2 c2">
							<input id="txtFirstName" name="FirstName" class="easyui-textbox" style="height:27px; width:300px;" data-options="required:true, validType:['length[1,100]']" />
						</td>
					</tr>
					<tr>
						<td style="text-align: right;" class="w1 c3">@Resources.FullName：</td>
						<td style="text-align: left;" class="w2 c4">
							<input id="txtFullName" name="FullName" class="easyui-textbox" style="height:27px; width:300px;" data-options="validType:['length[1,100]']" />
						</td>
						<td style="text-align: right;" class="w1 c3">@Resources.Sort：</td>
						<td style="text-align: left;" class="w2 c4">
							<input id="txtSort" name="Sort" class="easyui-numberbox" style="height:27px; width:300px;" />
						</td>
					</tr>
					<tr>
						<td style="text-align: right;" class="w1 c3">@Resources.ContactAddress：</td>
						<td style="text-align: left;" class="w2 c4" colspan="3">
							<input id="txtAddress" name="Address" class="easyui-textbox" style="height:27px; width:892px;" data-options="validType:['length[1,200]']" />
						</td>
					</tr>
					<tr>
						<td style="text-align: right;" class="w1 c1">@Resources.ZipCode：</td>
						<td style="text-align: left;" class="w2 c2">
							<input id="txtZipCode" name="ZipCode" class="easyui-textbox" style="height:27px; width:300px;" data-options="validType:['length[1,100]']" />
						</td>
						<td style="text-align: right;" class="w1 c1">@Resources.Email：</td>
						<td style="text-align: left;" class="w2 c2">
							<input id="txtMail" name="Mail" class="easyui-textbox" style="height:27px; width:300px;" data-options="required:true, validType:['email','length[1,100]']" />
						</td>
					</tr>
					<tr>
						<td style="text-align: right;" class="w1 c3">@Resources.Mobile：</td>
						<td style="text-align: left;" class="w2 c4">
							<input id="txtMobile" name="Mobile" class="easyui-textbox" style="height:27px; width:300px;" data-options="required:true, validType:['length[1,100]']" />
						</td>
						<td style="text-align: right;" class="w1 c3">@Resources.CcMail：</td>
						<td style="text-align: left;" class="w2 c4">
							<input id="txtCcMail" name="CcMail" class="easyui-textbox" style="height:27px; width:300px;" />
						</td>
					</tr>
					<tr>
						<td style="text-align: right; " class="w1 c1">@Resources.PersonalIntroduction：</td>
						<td style="text-align: left;" class="w2 c2" colspan="3">
							<input id="txtSelfIntroduction" name="SelfIntroduction" class="easyui-textbox" style="height:100px; width:892px;" data-options="multiline:true" />
						</td>
					</tr>
					<tr>
						<td style="text-align: right;" class="w1 c3">@Resources.Status：</td>
						<td style="text-align: left;" class="w2 c4">
							<select id="ddlStatus" name="Status" class="easyui-combobox" style="height:27px; width:300px;" data-options="editable:false,required:true,panelHeight:'auto'">
								<option value="@ConstValues.Status.正常">@Resources.Normal</option>
								<option value="@ConstValues.Status.暂停">@Resources.Pause</option>
							</select>
						</td>
						<td style="text-align: right;" class="w1 c3"></td>
						<td style="text-align: left;" class="w2 c4"></td>
					</tr>
					<tr>
						<td style="text-align: right; " class="w1 c1">@Resources.Remark：</td>
						<td style="text-align: left;" class="w2 c2" colspan="3">
							<input id="txtRemark" name="Remark" class="easyui-textbox" style="height:50px; width:892px;" data-options="multiline:true, validType:['length[1,1000]']" />
						</td>
					</tr>
				</table>
				<h3 class="tit01"><a href="javascript:void(0);" class="easyui-linkbutton" iconcls="icon-add" style="background:#919295;color:#000;border:none;margin-left:5px;" onclick="common.addAffliation();">@Resources.Create@Resources.Affiliation</a></h3>
				<table width="100%" height="100%" id="tblAuthor" cellpadding="0" cellspacing="1" border="0" class="tastyle01">
					<tr id="trAffiliation0">
						<td style="text-align: right;" class="w1 c1">@Resources.Affiliation 1：</td>
						<td style="text-align: left;" class="w12 c2">
							<input id="txtAffiliation0" name="Affiliation0" class="easyui-textbox" style="height:27px; width:380px;" data-options="required:true,validType:['length[1,4000]']" />
						</td>
						<td style="text-align: right;" class="w8 c1">@Resources.Country 1：</td>
						<td style="text-align: left;" class="w2 c2">
							<input id="ddlCountry0" name="Country0" class="easyui-combobox" style="height:27px; width:300px;">
						</td>
					</tr>
					<tr id="trAffiliation1" style="display:none">
						<td style="text-align: right;" class="w1 c3">@Resources.Affiliation 2：</td>
						<td style="text-align: left;" class="w12 c4">
							<input id="txtAffiliation1" name="Affiliation1" class="easyui-textbox" style="height:27px; width:380px;" data-options="validType:['length[1,4000]']" />
						</td>
						<td style="text-align: right;" class="w8 c3">@Resources.Country 2：</td>
						<td style="text-align: left;" class="w2 c4">
							<input id="ddlCountry1" name="Country1" class="easyui-combobox" style="height:27px; width:300px;">
						</td>
					</tr>
					<tr id="trAffiliation2" style="display:none">
						<td style="text-align: right;" class="w1 c1">@Resources.Affiliation 3：</td>
						<td style="text-align: left;" class="w12 c2">
							<input id="txtAffiliation2" name="Affiliation2" class="easyui-textbox" style="height:27px; width:380px;" data-options="validType:['length[1,4000]']" />
						</td>
						<td style="text-align: right;" class="w8 c1">@Resources.Country 3：</td>
						<td style="text-align: left;" class="w2 c2">
							<input id="ddlCountry2" name="Country2" class="easyui-combobox" style="height:27px; width:300px;">
						</td>
					</tr>
					<tr id="trAffiliation3" style="display:none">
						<td style="text-align: right;" class="w1 c3">@Resources.Affiliation 4：</td>
						<td style="text-align: left;" class="w12 c4">
							<input id="txtAffiliation3" name="Affiliation3" class="easyui-textbox" style="height:27px; width:380px;" data-options="validType:['length[1,4000]']" />
						</td>
						<td style="text-align: right;" class="w8 c3">@Resources.Country 4：</td>
						<td style="text-align: left;" class="w2 c4">
							<input id="ddlCountry3" name="Country3" class="easyui-combobox" style="height:27px; width:300px;">
						</td>
					</tr>
					<tr id="trAffiliation4" style="display:none">
						<td style="text-align: right;" class="w1 c1">@Resources.Affiliation 5：</td>
						<td style="text-align: left;" class="w12 c2">
							<input id="txtAffiliation4" name="Affiliation4" class="easyui-textbox" style="height:27px; width:380px;" data-options="validType:['length[1,4000]']" />
						</td>
						<td style="text-align: right;" class="w8 c1">@Resources.Country 5：</td>
						<td style="text-align: left;" class="w2 c2">
							<input id="ddlCountry4" name="Country4" class="easyui-combobox" style="height:27px; width:300px;">
						</td>
					</tr>
					<tr id="trAffiliation5" style="display:none">
						<td style="text-align: right;" class="w1 c3">@Resources.Affiliation 6：</td>
						<td style="text-align: left;" class="w12 c4">
							<input id="txtAffiliation5" name="Affiliation5" class="easyui-textbox" style="height:27px; width:380px;" data-options="validType:['length[1,4000]']" />
						</td>
						<td style="text-align: right;" class="w8 c3">@Resources.Country 6：</td>
						<td style="text-align: left;" class="w2 c4">
							<input id="ddlCountry5" name="Country5" class="easyui-combobox" style="height:27px; width:300px;">
						</td>
					</tr>
					<tr id="trAffiliation6" style="display:none">
						<td style="text-align: right;" class="w1 c1">@Resources.Affiliation 7：</td>
						<td style="text-align: left;" class="w12 c2">
							<input id="txtAffiliation6" name="Affiliation6" class="easyui-textbox" style="height:27px; width:380px;" data-options="validType:['length[1,4000]']" />
						</td>
						<td style="text-align: right;" class="w8 c1">@Resources.Country 7：</td>
						<td style="text-align: left;" class="w2 c2">
							<input id="ddlCountry6" name="Country6" class="easyui-combobox" style="height:27px; width:300px;">
						</td>
					</tr>
					<tr id="trAffiliation7" style="display:none">
						<td style="text-align: right;" class="w1 c3">@Resources.Affiliation 8：</td>
						<td style="text-align: left;" class="w12 c4">
							<input id="txtAffiliation7" name="Affiliation7" class="easyui-textbox" style="height:27px; width:380px;" data-options="validType:['length[1,4000]']" />
						</td>
						<td style="text-align: right;" class="w8 c3">@Resources.Country 8：</td>
						<td style="text-align: left;" class="w2 c4">
							<input id="ddlCountry7" name="Country7" class="easyui-combobox" style="height:27px; width:300px;">
						</td>
					</tr>
					<tr id="trAffiliation8" style="display:none">
						<td style="text-align: right;" class="w1 c1">@Resources.Affiliation 9：</td>
						<td style="text-align: left;" class="w12 c2">
							<input id="txtAffiliation8" name="Affiliation8" class="easyui-textbox" style="height:27px; width:380px;" data-options="validType:['length[1,4000]']" />
						</td>
						<td style="text-align: right;" class="w8 c1">@Resources.Country 9：</td>
						<td style="text-align: left;" class="w2 c2">
							<input id="ddlCountry8" name="Country8" class="easyui-combobox" style="height:27px; width:300px;">
						</td>
					</tr>
					<tr id="trAffiliation9" style="display:none">
						<td style="text-align: right;" class="w1 c3">@Resources.Affiliation 10：</td>
						<td style="text-align: left;" class="w12 c4">
							<input id="txtAffiliation9" name="Affiliation9" class="easyui-textbox" style="height:27px; width:380px;" data-options="validType:['length[1,4000]']" />
						</td>
						<td style="text-align: right;" class="w8 c3">@Resources.Country 10：</td>
						<td style="text-align: left;" class="w2 c4">
							<input id="ddlCountry9" name="Country9" class="easyui-combobox" style="height:27px; width:300px;">
						</td>
					</tr>
				</table>
			</form>
			<div class="btnDiv">
				<input type="hidden" id="hdnAuthorWindowType" />
				<input type="button" class="gbtn" id="addContributionAuthor" onclick="addAuthor();" value="@Resources.Submit" />&nbsp;&nbsp;
				<input type="button" class="rbtn" onclick="$('#authorWindow').window('close');" value="@Resources.Cancel" />
			</div>
		</div>
	</div>
</div>
<!-- 作者画面 end -->
<!-- 评优画面 start -->
<div id="awardsWindow" class="easyui-window"
     title="@Resources.Awards" data-options="closed:true,minimizable:false,maximizable:false,iconCls:'icon-save'"
     style="width:1200px; display:none;">
	<div class="main">
		<div class="box clearfix">
			<h3 id="detailWindowTitle" class="tit01">@Resources.Awards</h3>
			<div class="formDiv">
				<form id="frmAwards" method="post" enctype="multipart/form-data">
					@Html.AntiForgeryToken()
					<input type="hidden" id="hidAwardsConferenceId" name="ConferenceId" />
					<input type="hidden" id="hidAwardsContributeId" name="ContributeId" />
					<input type="hidden" id="hidAwardsId" name="Id" />
					<div id="awardsDG"></div>
				</form>
			</div>
		</div>
	</div>
</div>
<!-- 评优画面 end -->

@section Scripts {
<script>
	var windowHeight = $(window).height() - 200;
	$("#mainFrame").css("height", (windowHeight)+"px");

	var language = "@Request.Cookies["_culture"].Value";
	if (language == "@ConstValues.Language.Cn") {
		CKEDITOR.config.language = "zh-cn";
	} else {
		CKEDITOR.config.language = "en";
	}

	$(function () {
		$("#queryConferenceName").textbox("textbox").bind("keydown", function (e) {
			if (e.keyCode == 13) {
				searchData()
			}
		});
		$("#queryEssayTitle").textbox("textbox").bind("keydown", function (e) {
			if (e.keyCode == 13) {
				searchData()
			}
		});

		$("input",$("#txtFullName").next("span")).click(function(){
			var conferenceLanguage = $("#hidConferenceLanguage").val();
			var tempTxt = "";
			if (conferenceLanguage == "@ConstValues.Language.Cn") {
				//tempTxt = $("#txtFamilyName").textbox("getValue")+$("#txtFirstName").textbox("getValue") ;
			} else {
				tempTxt = $("#txtFirstName").textbox("getValue") +" "+$("#txtFamilyName").textbox("getValue") ;
			}

			$("#txtFullName").textbox("setValue",tempTxt);
		})

		$("#dataGrid").datagrid({
			url: "@Url.Action(nameof(ProfileContributeInfoController.GetData),
					nameof(ProfileContributeInfoController).GetControllerName())",
			method: "get",
			fitColumns: true,
			singleSelect: true,
			width: 1200,
			height: $(window).height() - 110,
			nowrap: false,
			pagination: true,
			pageSize: @ConstValues.DefaultGridRows,
			striped: true,
			toolbar: "#toolBar",
			pageSize: 100,
			pageList: [100, 200, 300, 400, 500],
			frozenColumns: [[
				{
					field: "operate", title: "@Resources.Operate", align: "center", width: 150,
					formatter: function (value, rec) {
						if (rec.contributationStatus=="@ConstValues.ContributationStatus.待审") {
							var tmp = rec.essayTitle == null ? "" : rec.essayTitle.replace(new RegExp("'",'g'),"’").replace(new RegExp('"','g'),"“");
							var strInfo = "<a href='#' style='color:#66CDAA;font-weight:bold;text-decoration:underline;' onclick='editData(\""
								+ rec.id + "\",\"" + rec.conferenceId + "\")'>@Resources.Modify</a> | <a href='#' style='color:#DC143C;font-weight:bold;text-decoration:underline;' onclick='deleteData(\""
								+ rec.id + "\",\"" + tmp + "\")'>@Resources.Delete</a> | <a href='#' style='color:#FF8C00;font-weight:bold;text-decoration:underline;' onclick='openAwards(\""
								+ rec.id + "\",\""+ rec.conferenceId + "\")'>@Resources.Awards</a>";
							return strInfo;
						} else {
							return "<a href='#' style='color:#1874CD;text-decoration:underline;' onclick='openAwards(\""
								+ rec.id + "\",\""+ rec.conferenceId + "\")'>@Resources.Awards</a>";
						}
					}
				},
				{
					field: "conferenceName", title: "@Resources.ConferenceName", align: "center", sortable: true, width: 350 ,
					formatter: function (value, rec) {
						var conStr = ""
						if (rec.homePageUrl != null && rec.homePageUrl != "") {
							conStr += "<a href=' "+ rec.homePageUrl +" ' style='color:#1874CD;text-decoration:underline;' target='_blank'>" + value + "</a>";
						} else {
							var tmp = rec.conferenceNickName == null ? "" : rec.conferenceNickName.replace(new RegExp("'",'g'),"’").replace(new RegExp('"','g'),"“");
							conStr += "<a href='@Url.Action(nameof(MeetingMainController.Index), nameof(MeetingMainController).GetControllerName())"
									+ "/" + tmp +"' style='color:#1874CD;text-decoration:underline;' target='_blank'>" + value + "</a>  ";
						}
						return conStr;
					}
				},
			]],
			columns: [[
				{
					field: "id", title: "@Resources.EssayId", align: "center", sortable: true, width: 150,
					formatter: function (value, rec) {
						var strInfo = "<a href='#' style='color:#1874CD;text-decoration:underline;' onclick='lookupReview(\""
								+ rec.id + "\",\""+ rec.conferenceId + "\")'>"+value+"</a>";
						return strInfo;
					}
				},
				{
					field: "essayTitle", title: "@Resources.EssayTitle", align: "center", sortable: true, width: 150,
					formatter: function (value, rec) {
						var strInfo = "<a href='#' style='color:#1874CD;text-decoration:underline;' onclick='lookupReview(\""
								+ rec.id + "\",\""+ rec.conferenceId + "\")'>"+value+"</a>";
						return strInfo;
					}
				},
				{
					field: "author", title: "@Resources.Author", align: "center", width: 100,
					formatter: function(value, rec) {
						var strInfo = "<a href='#' style='color:#1874CD;text-decoration:underline;' onclick='openAuthor(\""
								+ rec.id + "\",\""+ rec.conferenceId + "\",\""+ rec.contributationStatus + "\",\""+ rec.isInternational + "\")'>@Resources.Check</a>";
						return strInfo;
					}
				},
				{
					field: "contributationStatus", title: "@Resources.ContributationStatus", align: "center", sortable: true, width: 150,
					formatter: function(value, rec) {
						if (rec.adminStatus == "@ConstValues.ContributationStatus.录用") {
							return "@Resources.StatusReviewAccept";
						} else if (rec.adminStatus == "@ConstValues.ContributationStatus.不录用") {
							return "@Resources.StatusReviewReject";
						} else if (rec.contributationStatus == "@ConstValues.ContributationStatus.录用") {
							return "@Resources.StatusReviewAccept";
						} else if (rec.contributationStatus == "@ConstValues.ContributationStatus.不录用") {
							return "@Resources.StatusReviewReject";
						} else if (rec.contributationStatus == "@ConstValues.ContributationStatus.待审") {
							return "@Resources.StatusReadyToReview";
						} else if (rec.contributationStatus == "@ConstValues.ContributationStatus.审核中") {
							return "@Resources.StatusReviewing";
						}
					}
				},
				{ field: "createDate", title: "@Resources.ContributeDate", align: "center", sortable: true, width: 150 },
			]]
		});

		$("#detailWindow").window({
			onOpen: function () {
				$(this).scrollTop(0);
				$("#ctnForm").html("");
			},
			height: 800,
			top: 100
		});

		$("#awardsWindow").window({
			onOpen: function () {
				$(this).scrollTop(0);
			},
			top: ($(window).height() - 600) * 0.5
		});

		$("#lookupReview").window({
			onOpen: function () {
				$(this).scrollTop(0);
			},
			height: 800,
			top: 100
		});

		$("#authorWindow").window({
			onOpen: function () {
				$(this).scrollTop(0);
			},
			height: 800,
			top: 100
		});
	});

	function searchData() {
		$("#dataGrid").datagrid("load", {
			queryConferenceName: $("#queryConferenceName").textbox("getValue"),
			queryEssayTitle: $("#queryEssayTitle").textbox("getValue"),
		});
	}

	function deleteData(id, essayTitle) {
		var confirmMessage = "@Resources.CfmDelete";
		confirmMessage = confirmMessage.replace(/\{0\}/g, essayTitle);
		$.messager.confirm("@Resources.Delete", confirmMessage, function (r) {
			if (r) {
				$.post("@Url.Action(nameof(ProfileContributeInfoController.Delete),
						nameof(ProfileContributeInfoController).GetControllerName())"+"/"+id,
					$("#dataGrid").serialize(),
					function(data, textStatus, jqXHR) {
						if (data.result == "@ConstValues.AjaxFailResult") {
							common.showError(data.message);
						} else {
							common.showSuccess(data.message, true);
							$("#detailWindow").window("close");
							$("#dataGrid").datagrid("reload");
						}
					}
				);
			}
		});
	}

	function editData(id, conferenceId) {
		$("#hidConferenceId").val(conferenceId);
		$("#hContributeId").val(id);
		$("#hidIsNormal").val(0);
		var url = "@Url.Action(nameof(UtilityController.GetCurrentPageItemContribute),
				nameof(UtilityController).GetControllerName())?conferenceId=" + conferenceId;

		$.get(url, null, function (data, textStatus, jqXHR) {
			if (data.result == "@ConstValues.AjaxSuccessResult") {
				for (var index = 0; index < data.data.length; index++) {
					if (data.data[index].key == "AbstractFile" || data.data[index].key == "SupplementaryFile") {
						$("#ctnForm").append("<div class='titleDiv'>" + data.data[index].displayName + "：</div>"
							+ "<div class='contentDiv'>"
							+ "<input class='easyui-filebox' style='height:27px; width:500px' id='txt" + data.data[index].key + "' name='" + data.data[index].key + "' />"
							+ "&nbsp;&nbsp;<a href='javascript:void(0)' class='easyui-linkbutton' id='txt" + data.data[index].key + "Clear' onclick='$(\"#txt" + data.data[index].key + "\").filebox(\"clear\");$(\"#hid" + data.data[index].key + "\").val(\"@ConstValues.clearFlg\");'>@Resources.Clear</a>"
							+ "</div>"
							+ "<input id='hid"+data.data[index].key+"' name='" + data.data[index].key + "Path' type='hidden' />"
							+ "<div class='clear'></div>"
						);

						$("#txt" + data.data[index].key).filebox({
							prompt: data.data[index].tip,
							required: data.data[index].isRequired,
							buttonText: "@Resources.ChooseFile"
						});
					}
					else if (data.data[index].key == "Topic") {
						$("#ctnForm").append("<div class='titleDiv'>" + data.data[index].displayName + "：</div>"
							+ "<div class='contentDiv'>"
							+ "<input class='easyui-combobox' style='height:27px; width:500px' id='txtTopic' name='Topic' />"
							+ "&nbsp;&nbsp;<a href='javascript:void(0)' class='easyui-linkbutton' id='txtTopicClear' onclick='$(\"#txtTopic\").combobox(\"clear\");'>@Resources.Clear</a>"
							+ "</div>"
							+ "<div class='clear'></div>"
						);

						var orgCount = 0;
						$("#txtTopic").combobox({
							prompt: data.data[index].tip,
							required: data.data[index].isRequired,
							editable: false,
							valueField: "id",
							textField: "name",
							url: "@Url.Action(nameof(UtilityController.GetTopic), nameof(UtilityController).GetControllerName())"
									+ "?conferenceId=" + conferenceId,
							onLoadSuccess: function(data) {
								orgCount = data.length;
							},
							onShowPanel: function () {
								if (orgCount < 10) {
									$(this).combobox("panel").height("auto");
								} else {
									$(this).combobox("panel").height(200);
								}
							}
						});
					}
					else if (data.data[index].key == "Essay") {
						$("#ctnForm").append("<div class='titleDiv'>" + data.data[index].displayName + "：</div>"
							+ "<div class='contentDiv'>"
							+ "<input class='easyui-combobox' style='height:27px; width:500px' id='txtEssay' name='Essay' />"
							+ "&nbsp;&nbsp;<a href='javascript:void(0)' class='easyui-linkbutton' id='txtEssayClear' onclick='$(\"#txtEssay\").combobox(\"clear\");'>@Resources.Clear</a>"
							+ "</div>"
							+ "<div class='clear'></div>"
						);

						var orgCount = 0;
						$("#txtEssay").combobox({
							prompt: data.data[index].tip,
							required: data.data[index].isRequired,
							editable: false,
							valueField: "id",
							textField: "name",
							url: "@Url.Action(nameof(UtilityController.GetEssay), nameof(UtilityController).GetControllerName())"
									+ "?conferenceId=" + conferenceId,
							onLoadSuccess: function(data) {
								orgCount = data.length;
							},
							onShowPanel: function () {
								if (orgCount < 10) {
									$(this).combobox("panel").height("auto");
								} else {
									$(this).combobox("panel").height(200);
								}
							}
						});
					}
					else if (data.data[index].key == "Report") {
						$("#ctnForm").append("<div class='titleDiv'>" + data.data[index].displayName + "：</div>"
							+ "<div class='contentDiv'>"
							+ "<input class='easyui-combobox' style='height:27px; width:500px' id='txtReport' name='Report' />"
							+ "&nbsp;&nbsp;<a href='javascript:void(0)' class='easyui-linkbutton' id='txtReportClear' onclick='$(\"#txtReport\").combobox(\"clear\");'>@Resources.Clear</a>"
							+ "</div>"
							+ "<div class='clear'></div>"
						);

						var orgCount = 0;
						$("#txtReport").combobox({
							prompt: data.data[index].tip,
							required: data.data[index].isRequired,
							editable: false,
							valueField: "id",
							textField: "name",
							url: "@Url.Action(nameof(UtilityController.GetReport), nameof(UtilityController).GetControllerName())"
									+ "?conferenceId=" + conferenceId,
							onLoadSuccess: function(data) {
								orgCount = data.length;
							},
							onShowPanel: function () {
								if (orgCount < 10) {
									$(this).combobox("panel").height("auto");
								} else {
									$(this).combobox("panel").height(200);
								}
							}
						});
					}
					else if (data.data[index].key == "Ocis") {
						$("#ctnForm").append("<div class='titleDiv'>" + data.data[index].displayName + "：</div>"
							+ "<div class='contentDiv'>"
							+ "<input class='easyui-combobox' style='height:27px; width:500px' id='txtOcis' name='Ocis' />"
							+ "&nbsp;&nbsp;<a href='javascript:void(0)' class='easyui-linkbutton' id='txtOcisClear' onclick='$(\"#txtOcis\").combobox(\"clear\");'>@Resources.Clear</a>"
							+ "</div>"
							+ "<div class='clear'></div>"
						);

						var orgCount = 0;
						$("#txtOcis").combobox({
							prompt: data.data[index].tip,
							required: data.data[index].isRequired,
							editable: false,
							valueField: "id",
							textField: "name",
							url: "@Url.Action(nameof(UtilityController.GetOCIS), nameof(UtilityController).GetControllerName())"
									+ "?conferenceId=" + conferenceId,
							onLoadSuccess: function(data) {
								orgCount = data.length;
							},
							onShowPanel: function () {
								if (orgCount < 10) {
									$(this).combobox("panel").height("auto");
								} else {
									$(this).combobox("panel").height(200);
								}
							}
						});
					}
					else if (data.data[index].key == "Journal") {
						$("#ctnForm").append("<div class='titleDiv'>" + data.data[index].displayName + "：</div>"
							+ "<div class='contentDiv'>"
							+ "<input class='easyui-combobox' style='height:27px; width:500px' id='txtJournal' name='Journal' />"
							+ "&nbsp;&nbsp;<a href='javascript:void(0)' class='easyui-linkbutton' id='txtJournalClear' onclick='$(\"#txtJournal\").combobox(\"clear\");'>@Resources.Clear</a>"
							+ "</div>"
							+ "<div class='clear'></div>"
						);

						var orgCount = 0;
						$("#txtJournal").combobox({
							prompt: data.data[index].tip,
							required: data.data[index].isRequired,
							editable: false,
							valueField: "id",
							textField: "name",
							url: "@Url.Action(nameof(UtilityController.GetJournal), nameof(UtilityController).GetControllerName())"
									+ "?conferenceId=" + conferenceId,
							onLoadSuccess: function(data) {
								orgCount = data.length;
							},
							onShowPanel: function () {
								if (orgCount < 10) {
									$(this).combobox("panel").height("auto");
								} else {
									$(this).combobox("panel").height(200);
								}
							}
						});
					}
					else if (data.data[index].key == "ProgramAbstract") {
						if ($("#txtAbstract").length == 0) {
							$("#ctnForm").append("<div class='titleDiv large'>" + data.data[index].displayName + "：</div>"
								+ "<div class='contentDiv large'>"
								+"<input type=hidden id='txtProgramAbstract' name='ProgramAbstract' />"
								+"<div class='grid-container'>"
								+"<div class='grid-width-100' style='margin-left:-30px; height:100px; width:560px'>"
								+"<textarea cols='90' rows='10' id='editor' name='editor'></textarea>"
								+"</div>"
								+"</div>"
								+ "<div class='clear'></div>"
							);
						} else {
							$("#ctnForm").append("<div class='titleDiv large'>" + data.data[index].displayName + "：</div>"
								+ "<div class='contentDiv large'>"
								+"<input type=hidden id='txtProgramAbstract' name='ProgramAbstract' />"
								+"<div class='grid-container'>"
								+"<div class='grid-width-100' style='margin-left:-30px; height:100px; width:560px'>"
								+"<textarea cols='90' rows='10' id='editorSec' name='editor'></textarea>"
								+"</div>"
								+"</div>"
								+ "<div class='clear'></div>"
							);
							$("#hidIsNormal").val(1);
						}

						if (data.data[index].isRequired == true) {
							$("#hidProgramAbstract").val(1);
						} else {
							$("#hidProgramAbstract").val(0);
						}
					}
					else if (data.data[index].key == "Abstract") {
						if ($("#txtProgramAbstract").length == 0) {
							$("#ctnForm").append("<div class='titleDiv large'>" + data.data[index].displayName + "：</div>"
								+ "<div class='contentDiv large'>"
								+"<input type=hidden id='txtAbstract' name='Abstract' />"
								+"<div class='grid-container'>"
								+"<div class='grid-width-100' style='margin-left:-30px; height:100px; width:560px'>"
								+"<textarea cols='90' rows='10' id='editor' name='editorSec'></textarea>"
								+"</div>"
								+"</div>"
								+ "<div class='clear'></div>"
							);
							$("#hidIsNormal").val(1);
						} else {
							$("#ctnForm").append("<div class='titleDiv large'>" + data.data[index].displayName + "：</div>"
								+ "<div class='contentDiv large'>"
								+"<input type=hidden id='txtAbstract' name='Abstract' />"
								+"<div class='grid-container'>"
								+"<div class='grid-width-100' style='margin-left:-30px; height:100px; width:560px'>"
								+"<textarea cols='90' rows='10' id='editorSec' name='editorSec'></textarea>"
								+"</div>"
								+"</div>"
								+ "<div class='clear'></div>"
							);
						}

						if (data.data[index].isRequired == true) {
							$("#hidAbstract").val(1);
						} else {
							$("#hidAbstract").val(0);
						}
					}
					else {
						$("#ctnForm").append("<div class='titleDiv'>" + data.data[index].displayName + "：</div>"
							+ "<div class='contentDiv'>"
							+ "<input class='easyui-textbox' style='height:27px; width:500px' id='txt" + data.data[index].key + "' name='" + data.data[index].key + "' />"
							+ "</div>"
							+ "<div class='clear'></div>"
						);

						$("#txt" + data.data[index].key).textbox({
							prompt: data.data[index].tip,
							required: data.data[index].isRequired,
							validType: "length[1,500]"
						});
					}
				}

				url = "@Url.Action(nameof(UtilityController.GetCurrentPageValueContribute),
						nameof(UtilityController).GetControllerName())"
						+ "/" + id
						+ "?random=" + Math.random();
				$.get(url, null, function (data, textStatus, jqXHR) {
					if (data.result == "@ConstValues.AjaxSuccessResult") {
						if ($("#txtProgramAbstract").length > 0 || $("#txtAbstract").length > 0) {
							var language = data.data.language;
							if (language == "@ConstValues.Language.Cn") {
								CKEDITOR.config.language = "zh-cn";
							} else {
								CKEDITOR.config.language = "en";
							}
							initSample();

							if ($("#editor").length > 0) {
								if (CKEDITOR.instances["editor"]) {
									CKEDITOR.instances["editor"].destroy();
								}

								if ($("#hidIsNormal").val() == 0) {
									if (language == "@ConstValues.Language.Cn") {
										ckeditor = CKEDITOR.replace("editor", {
											wordcount: {
												extraPlugins: "wordcount",
												showWordCount: false,
												showCharCount: true,
												showParagraphs: false,
												maxCharCount: 240,
											}
										});
										CKFinder.setupCKEditor(ckeditor,"~/Scripts/ckfinder/")
									} else {
										ckeditor = CKEDITOR.replace("editor", {
											wordcount: {
												extraPlugins: "wordcount",
												showWordCount: true,
												showCharCount: false,
												showParagraphs: false,
												maxWordCount: 300,
											}
										});
										CKFinder.setupCKEditor(ckeditor,"~/Scripts/ckfinder/")
									}
								} else {
									if (language == "@ConstValues.Language.Cn") {
										ckeditor = CKEDITOR.replace("editor", {
											wordcount: {
												extraPlugins: "wordcount",
												showWordCount: false,
												showCharCount: true,
												showParagraphs: false,
												maxCharCount: 1000,
											}
										});
										CKFinder.setupCKEditor(ckeditor,"~/Scripts/ckfinder/")
									} else {
										ckeditor = CKEDITOR.replace("editor", {
											wordcount: {
												extraPlugins: "wordcount",
												showWordCount: true,
												showCharCount: false,
												showParagraphs: false,
												maxWordCount: 1500,
											}
										});
										CKFinder.setupCKEditor(ckeditor,"~/Scripts/ckfinder/")
									}
								}
								CKEDITOR.instances.editor.setData("");
							}
							if ($("#editorSec").length > 0) {
								if ($("#hidIsNormal").val() == 0) {
									if (language == "@ConstValues.Language.Cn") {
										ckeditor2 = CKEDITOR.replace("editorSec", {
											wordcount: {
												extraPlugins: "wordcount",
												showWordCount: false,
												showCharCount: true,
												showParagraphs: false,
												maxCharCount: 1000,
											}
										});
										CKFinder.setupCKEditor(ckeditor2,"~/Scripts/ckfinder/")
									} else {
										ckeditor2 = CKEDITOR.replace("editorSec", {
											wordcount: {
												extraPlugins: "wordcount",
												showWordCount: true,
												showCharCount: false,
												showParagraphs: false,
												maxWordCount: 1500,
											}
										});
										CKFinder.setupCKEditor(ckeditor2,"~/Scripts/ckfinder/")
									}
								} else {
									if (language == "@ConstValues.Language.Cn") {
										ckeditor2 = CKEDITOR.replace("editorSec", {
											wordcount: {
												extraPlugins: "wordcount",
												showWordCount: false,
												showCharCount: true,
												showParagraphs: false,
												maxCharCount: 240,
											}
										});
										CKFinder.setupCKEditor(ckeditor2,"~/Scripts/ckfinder/")
									} else {
										ckeditor2 = CKEDITOR.replace("editorSec", {
											wordcount: {
												extraPlugins: "wordcount",
												showWordCount: true,
												showCharCount: false,
												showParagraphs: false,
												maxWordCount: 300,
											}
										});
										CKFinder.setupCKEditor(ckeditor2,"~/Scripts/ckfinder/")
									}
								}
								CKEDITOR.instances.editorSec.setData("");
							}
						}

						$("#txtEssayTitle").textbox("setValue", data.data.essayTitle);
						$("#txtKeyword").textbox("setValue", data.data.keyword);
						$("#txtAbstractFile").filebox("setText", data.data.abstractFile);
						$("#txtSupplementaryFile").filebox("setText", data.data.supplementaryFile);
						$("#txtTopic").combobox("setValue", data.data.topicId);
						$("#txtEssay").combobox("setValue", data.data.essayId);
						$("#txtReport").combobox("setValue", data.data.reportId);
						$("#txtOcis").combobox("setValue", data.data.ocisId);
						$("#txtJournal").combobox("setValue", data.data.journalId);

						if ($("#txtProgramAbstract").length > 0) {
							if ($("#hidIsNormal").val() == 0) {
								CKEDITOR.instances.editor.setData(data.data.programAbstract);
							} else {
								CKEDITOR.instances.editorSec.setData(data.data.programAbstract);
							}
						}

						if ($("#txtAbstract").length > 0) {
							if ($("#hidIsNormal").val() == 0) {
								CKEDITOR.instances.editorSec.setData(data.data.abstract);
							} else {
								CKEDITOR.instances.editor.setData(data.data.abstract);
							}
						}
					}
				});
			}
		});
		$("#detailWindow").window("open");
	}

	function saveData() {
		var isValid = $("#frmForm").form("validate");

		if ($("#txtAbstractFile").length > 0) {
			var abstractFile = $("#txtAbstractFile").filebox("getText")
			if (null != abstractFile && "" != abstractFile) {
				if (!/\.(doc|docx|pdf|DOC|DOCX|PDF)$/.test(abstractFile)) {
					common.showError("@Resources.MsgDocumentType");
					return;
				}
			}
		}

		if($("#txtSupplementaryFile").length > 0){
			var supplementaryFile = $("#txtSupplementaryFile").filebox("getText")
			if(null != supplementaryFile && "" != supplementaryFile){
				if (!/\.(doc|docx|pdf|DOC|DOCX|PDF)$/.test(supplementaryFile)){
					common.showError("@Resources.MsgDocumentType");
					return;
				}
			}
		}

		if ($("#txtProgramAbstract").length > 0) {
			if ($("#hidIsNormal").val() == 0) {
				if ($("#hidProgramAbstract").val() == 1 && CKEDITOR.instances.editor.getData() == "") {
					var errorMessage = "@Resources.MsgIsEmpty";
					errorMessage = errorMessage.replace(/\{0\}/g, "@Resources.ProgramAbstract");
					common.showError(errorMessage);
					CKEDITOR.instances.editor.focus();
					return;
				}
				$("#txtProgramAbstract").val(CKEDITOR.instances.editor.getData());
			} else {
				if ($("#hidProgramAbstract").val() == 1 && CKEDITOR.instances.editorSec.getData() == "") {
					var errorMessage = "@Resources.MsgIsEmpty";
					errorMessage = errorMessage.replace(/\{0\}/g, "@Resources.ProgramAbstract");
					common.showError(errorMessage);
					CKEDITOR.instances.editor.focus();
					return;
				}
				$("#txtProgramAbstract").val(CKEDITOR.instances.editorSec.getData());
			}
		}

		if ($("#txtAbstract").length > 0) {
			if ($("#hidIsNormal").val() == 0) {
				if ($("#hidAbstract").val() == 1 && CKEDITOR.instances.editorSec.getData() == "") {
					var errorMessage = "@Resources.MsgIsEmpty";
					errorMessage = errorMessage.replace(/\{0\}/g, "@Resources.Abstract");
					common.showError(errorMessage);
					CKEDITOR.instances.editor.focus();
					return;
				}
				$("#txtAbstract").val(CKEDITOR.instances.editorSec.getData());
			} else {
				if ($("#hidAbstract").val() == 1 && CKEDITOR.instances.editor.getData() == "") {
					var errorMessage = "@Resources.MsgIsEmpty";
					errorMessage = errorMessage.replace(/\{0\}/g, "@Resources.Abstract");
					common.showError(errorMessage);
					CKEDITOR.instances.editor.focus();
					return;
				}
				$("#txtAbstract").val(CKEDITOR.instances.editor.getData());
			}
		}

		if (isValid) {
			$.messager.confirm("@Resources.Submit", "@Resources.CfmSave", function (r) {
				if (r) {
					var loading = layer.load(0,  {
						shade: [0.4,"#fff"]
					});

					$("#frmForm").form({
						iframe: false,
						success: function (data) { }
					});

					$("#frmForm").form("submit", {
						url: "@Url.Action(nameof(ProfileContributeInfoController.Modify), nameof(ProfileContributeInfoController).GetControllerName())",
						onSubmit: function (param) {
							param.random = Math.random();
						},
						success: function (data) {
							layer.close(loading);
							data = JSON.parse(data);
							if (data.result == "@ConstValues.AjaxFailResult") {
								common.showError(data.message);
							} else {
								common.showSuccess(data.message, true);
								$("#detailWindow").window("close");
								$("#dataGrid").datagrid("reload");
							}
						},
					});
				}
			});
		}
	}

	function lookupReview(id, conferenceId) {
		$("#l-review_result").html("");
		$("#l-sysReviewResult").html("");
		$("#l-finalReviewResult").html("");
		$("#l-finalRemark").html("");
		$("#l-abstractFile").html("");
		$("#l-supplementaryFile").html("");

		$("span[id='l-contributionId']").html("");
		$("span[id='l-title']").html("");
		$("span[id='l-author']").html("");
		$("span[id='l-affiliation']").html("");
		$("span[id='l-abstract']").html("");
		$("span[id='l-keyword']").html("");
		$("span[id='l-topicName']").html("");
		$("span[id='l-essayTypeName']").html("");
		$("span[id='l-reportType']").html("");
		$("span[id='l-programAbstract']").html("");
		$("span[id='l-awards']").html("");
		$("span[id='l-remark']").html("");

		var url = "@Url.Action(nameof(UtilityController.GetContributeInfo),
				nameof(UtilityController).GetControllerName())" + "/" + id;
		$.get(url, null, function (data, textStatus, jqXHR) {
			if (data.result == "@ConstValues.AjaxFailResult") {
				common.showError(data.message);
			} else {
				$("#l-hdnWindowType").val("final");
				$("#l-hidID").val(id);
				$("#l-contributeId").val(data.data.contributeId);

				$("span[id='l-currentReviewId']").html("@((User as ICISPrincipal).UserName)");
				$("span[id='l-contributionId']").html(data.data.contributeId);
				$("span[id='l-title']").html(data.data.essayTitle);
				$("span[id='l-author']").html(data.data.author);
				$("span[id='l-affiliation']").html(data.data.affiliation);
				var abs = "";
				if (data.data.abstract != null) {
					var reg = new RegExp("<p>","g");
					var reg2 = new RegExp("</p>","g");
					abs = data.data.abstract.replace(reg,"");
					abs = abs.replace(reg2,"");
				}
				$("span[id='l-abstract']").html(abs);
				$("span[id='l-keyword']").html(data.data.keyword);
				$("span[id='l-topicName']").html(data.data.topicName);
				$("span[id='l-essayTypeName']").html(data.data.essayTypeName);
				$("span[id='l-reportType']").html(data.data.reportType);
				$("span[id='l-programAbstract']").html(data.data.programAbstract);
				$("span[id='l-awards']").html(data.data.awards);
				$("span[id='l-remark']").html(data.data.remark);

				if (data.data.abstractFile != null) {
					if (/\.(pdf|PDF)$/.test(data.data.abstractFile)) {
						$("#l-abstractFile").append('<a class="downloadLink" href="'+data.data.abstractFilePath+'" target="_blank">'+data.data.abstractFile+'</a>')
					} else {
						$("#l-abstractFile").append('<a class="downloadLink" href="@Url.Action(nameof(UtilityController.DownloadContributeFile),nameof(UtilityController).GetControllerName())/'+data.data.contributeId+'/@ConstValues.FileType.Abstract">'+data.data.abstractFile+'</a>')
					}
				}
				if (data.data.supplementaryFile != null) {
					if (/\.(pdf|PDF)$/.test(data.data.supplementaryFile)) {
						$("#l-supplementaryFile").append('<a class="downloadLink" href="'+data.data.supplementaryFilePath+'" target="_blank">'+data.data.supplementaryFile+'</a>')
					} else {
						$("#l-supplementaryFile").append('<a class="downloadLink" href="@Url.Action(nameof(UtilityController.DownloadContributeFile),nameof(UtilityController).GetControllerName())/'+data.data.contributeId+'/@ConstValues.FileType.Supplementary">'+data.data.supplementaryFile+'</a>')
					}
				}

				var tmp = '<tr><td style="text-align: right; " class="w1 c1">@Resources.SystemReviewResult：</td>';
				tmp += '<td style="text-align: left;" class="w10 c2">';
				tmp += '<div id="l-sysReviewResult"></div>';
				tmp += '</td></tr>';

				tmp += '<tr><td style="text-align: right; " class="w1 c3">@Resources.FinalReview：</td>';
				tmp += '<td style="text-align: left;" class="w10 c4 check_fl">';
				tmp += '<div id="l-finalReviewResult"></div>';
				tmp += '</td></tr>';

				if (data.data.isReview) {
					tmp += '<tr><td style="text-align: right; " class="w1 c1">@Resources.FinalReview@Resources.ReviewerComment：</td>';
					tmp += '<td style="text-align: left;" class="w10 c2">';
					tmp += data.data.advantage;
					tmp += '</td></tr>';
				}
				$("#l-finalRemark").append(tmp);

				if (data.data.contributationStatus == "@ConstValues.ContributationStatus.录用") {
					$("#l-finalReviewResult").append("@Resources.StatusReviewAccept");
				} else if (data.data.contributationStatus == "@ConstValues.ContributationStatus.不录用") {
					$("#l-finalReviewResult").append("@Resources.StatusReviewReject");
				} else if (data.data.contributationStatus == "@ConstValues.ContributationStatus.审核中") {
					$("#l-finalReviewResult").append("@Resources.StatusReviewing");
				} else {
					$("#l-finalReviewResult").append("@Resources.StatusReadyToReview");
				}

				$("#l-sysReviewResult").append("@Resources.StatusReadyToReview")
				var urlr = "@Url.Action(nameof(UtilityController.GetJuniorResult),
						nameof(UtilityController).GetControllerName())?id="+ id + "&userId=@((User as ICISPrincipal).UserID)";
				$.get(urlr, null, function (data, textStatus, jqXHR) {
					if (data.length > 0) {
						var AcceptCount = 0;
						var RejectCount = 0;
						for (var index = 0; index < data.length; index++) {
							var quality = ""
							if (data[index].quality == 1) {
								quality = "@ConstValues.ReviewQuality.One";
							} else if(data[index].quality == 2) {
								quality = "@ConstValues.ReviewQuality.Two";
							} else if(data[index].quality == 3) {
								quality = "@ConstValues.ReviewQuality.Three";
							} else if(data[index].quality == 4) {
								quality = "@ConstValues.ReviewQuality.Four";
							} else if(data[index].quality == 5) {
								quality = "@ConstValues.ReviewQuality.Five";
							} else if(data[index].quality == 6) {
								quality = "@ConstValues.ReviewQuality.Six";
							}

							var contributationStatus = "";
							if (data[index].result == "@ConstValues.ContributationStatus.待审") {
								contributationStatus += "@Resources.StatusReadyToReview";
							} else if(data[index].result == "@ConstValues.ContributationStatus.录用") {
								contributationStatus += "@Resources.StatusReviewAccept";
							} else if(data[index].result == "@ConstValues.ContributationStatus.不录用") {
								contributationStatus += "@Resources.StatusReviewReject";
							} else if(data[index].result == "@ConstValues.ContributationStatus.审核中") {
								contributationStatus += "@Resources.StatusReviewing";
							}

							var html = '<table width="100%" height="100%" id="tblDetail" cellpadding="0" cellspacing="1" border="0" class="tastyle01">'
								+'<tr>'
								+	'<td style="text-align: right; " class="w1 c1">@Resources.ReviewId：</td>'
								+	'<td style="text-align: left;" class="w10 c2" colspan="3">'
								+		''+ data[index].userName +''
								+	'</td>'
								+'</tr>'
								+'<tr>'
								+	'<td style="text-align: right; " class="w1 c3">Quailty：</td>'
								+	'<td style="text-align: left;" class="w10 c4">'
								+		''+ (quality != 0 ? quality  : "") +''
								+	'</td>'
								+'</tr>'
								+'<tr>'
								+	'<td style="text-align: right; " class="w1 c1">Rating：</td>'
								+	'<td style="text-align: left;" class="w10 c2">'
								+		''+ (data[index].evaluation != 0 ? data[index].evaluation : "") +''
								+	'</td>'
								+'</tr>'
								+'<tr>'
								+	'<td style="text-align: right; " class="w1 c3">Recommendation：</td>'
								+	'<td style="text-align: left;" class="w10 c4">' + contributationStatus
								+ 	'</td>'
								+'</tr>'
								+'<tr>'
								+	'<td style="text-align: right; " class="w1 c1">@Resources.Advantage：</td>'
								+	'<td style="text-align: left;" class="w10 c2" colspan="3">'
								+		''+ data[index].advantage +''
								+	'</td>'
								+'</tr>'
								+'<tr>'
								+	'<td style="text-align: right; " class="w1 c3">@Resources.Defect：</td>'
								+	'<td style="text-align: left;" class="w10 c4" colspan="3">'
								+		''+ data[index].defect +''
								+	'</td>'
								+'</tr>'
								+'</table>'

							$("#l-review_result").append(html);

							if (data[index].result == "@ConstValues.ContributationStatus.录用") {
								AcceptCount = AcceptCount + 1;
							} else if (data[index].result == "@ConstValues.ContributationStatus.不录用") {
								RejectCount = RejectCount + 1;
							}
						}

						$("#l-sysReviewResult").html("");
						if (AcceptCount == 0 && RejectCount == 0) {
							$("#l-sysReviewResult").append("@Resources.StatusReadyToReview");
						} else {
							if (AcceptCount > RejectCount) {
								$("#l-sysReviewResult").append("@Resources.StatusReviewAccept");
							} else if (AcceptCount <= RejectCount) {
								$("#l-sysReviewResult").append("@Resources.StatusReviewReject");
							}
						}
					}
				});
			}
		});
		$("#finalTrialTitle").text("@Resources.Lookup");
		$("#lookupReview").window("open");
	}

	//作者信息
	function openAuthor(id, conferenceId, contributationStatus, isInternational) {
		if (contributationStatus != "@ConstValues.ContributationStatus.待审" && contributationStatus != "@ConstValues.ContributationStatus.审核中") {
			$("#addContributionAuthor").hide();
		} else {
			$("#addContributionAuthor").show();
		}

		if (isInternational == "true") {
			$("#hidConferenceLanguage").val("@ConstValues.Language.En")
		} else {
			$("#hidConferenceLanguage").val("@ConstValues.Language.Cn")
		}

		$("#hidAuthorConferenceId").val(conferenceId);
		$("#hidContributeId").val(id);

		$("#ddlCountry0").combobox({
			url: "@Url.Action(nameof(UtilityController.GetCountry), nameof(UtilityController).GetControllerName())",
			valueField: "id",
			textField: "name",
			required: true
		});
		$("#ddlCountry1").combobox({
			url: "@Url.Action(nameof(UtilityController.GetCountry), nameof(UtilityController).GetControllerName())",
			valueField: "id",
			textField: "name",
			required: false
		});
		$("#ddlCountry2").combobox({
			url: "@Url.Action(nameof(UtilityController.GetCountry), nameof(UtilityController).GetControllerName())",
			valueField: "id",
			textField: "name",
			required: false
		});
		$("#ddlCountry3").combobox({
			url: "@Url.Action(nameof(UtilityController.GetCountry), nameof(UtilityController).GetControllerName())",
			valueField: "id",
			textField: "name",
			required: false
		});
		$("#ddlCountry4").combobox({
			url: "@Url.Action(nameof(UtilityController.GetCountry), nameof(UtilityController).GetControllerName())",
			valueField: "id",
			textField: "name",
			required: false
		});
		$("#ddlCountry5").combobox({
			url: "@Url.Action(nameof(UtilityController.GetCountry), nameof(UtilityController).GetControllerName())",
			valueField: "id",
			textField: "name",
			required: false
		});
		$("#ddlCountry6").combobox({
			url: "@Url.Action(nameof(UtilityController.GetCountry), nameof(UtilityController).GetControllerName())",
			valueField: "id",
			textField: "name",
			required: false
		});
		$("#ddlCountry7").combobox({
			url: "@Url.Action(nameof(UtilityController.GetCountry), nameof(UtilityController).GetControllerName())",
			valueField: "id",
			textField: "name",
			required: false
		});
		$("#ddlCountry8").combobox({
			url: "@Url.Action(nameof(UtilityController.GetCountry), nameof(UtilityController).GetControllerName())",
			valueField: "id",
			textField: "name",
			required: false
		});
		$("#ddlCountry9").combobox({
			url: "@Url.Action(nameof(UtilityController.GetCountry), nameof(UtilityController).GetControllerName())",
			valueField: "id",
			textField: "name",
			required: false
		});

		$("#authorDG").datagrid({
			url: "@Url.Action(nameof(UtilityController.GetAuthorList), nameof(UtilityController).GetControllerName())",
			method: "get",
			checkOnSelect: false,
			selectOnCheck: false,
			height: 200,
			nowrap: false,
			pageSize: @ConstValues.DefaultGridRows,
			striped: true,
			singleSelect: true,
			singleCheck: true,
			frozenColumns: [[
				{ field: "chk", align: "center", checkbox: true },
				{
					field: "operate", title: "@Resources.Operate", align: "center", width: 150,
					formatter: function(value, rec, index) {
						var tmp = rec.fullName == null ? "" : rec.fullName.replace(new RegExp("'",'g'),"’").replace(new RegExp('"','g'),"“");
						var strInfo = "<a href='#' style='color:#66CDAA;font-weight:bold;text-decoration:underline;' onclick='editAuthor(\""
							+ rec.id + "\",\""+ index + "\")'>@Resources.Modify</a>";
						strInfo += "&nbsp;|&nbsp;"
						strInfo += "<a href='#' style='color:#DC143C;font-weight:bold;text-decoration:underline;' onclick='deleteAuthor(\""
							+ rec.id + "\",\"" + tmp + "\")'>@Resources.Delete</a>";
						return strInfo;
					}
				},
				{ field: "sort", title: "@Resources.Sort", align: "center", width: 50 },
				{
					field: "fullName", title: "@Resources.FullName", align: "center", width: 200,
					formatter: function(value, rec){
						if (null != value && "" != value) {
							return value;
						} else {
							return rec.familyName + " " + rec.firstName
						}
					}
				},
				{ field: "mail", title: "@Resources.Mail", align: "center", width: 250 },
			]],
			columns: [[
				{ field: "affiliation", title: "@Resources.Affiliation", align: "center", width: 200 },
				{
					field: "status", title: "@Resources.Status", align: "center", width: 100,
					formatter: function(value, rec) {
						if (value=="@ConstValues.Status.正常") {
							return "@Resources.Normal"
						} else {
							return "@Resources.Pause"
						}
					}
				},
				{
					field: "isContactAuthor", title: "@Resources.ContactAuthor", align: "center", width: 150,
					formatter: function(value, rec) {
						var strInfo = "";
						if (rec.isContactAuthor == true) {
							strInfo = "<input type='checkbox' style='margin-top:8px;' onchange='changeContactAuthor(\"" + rec.id + "\")' checked/>";
						} else {
							strInfo = "<input type='checkbox' style='margin-top:8px;' onchange='changeContactAuthor(\"" + rec.id + "\")' />";
						}
						return strInfo;
					}
				},
				{
					field: "isPresenter", title: "@Resources.Presenter", align: "center", width: 100,
					formatter: function(value, rec) {
						var strInfo = "";
						if (rec.isPresenter == true) {
							strInfo = "<input type='checkbox' style='margin-top:8px;' onchange='changePresenter(\"" + rec.id + "\",this)' checked/>";
						} else {
							strInfo = "<input type='checkbox' style='margin-top:8px;' onchange='changePresenter(\"" + rec.id + "\",this)' />";
						}
						return strInfo;
					}
				},
				{ field: "remark", title: "@Resources.Remark", align: "center",  width: 200 },
				{ field: "familyName", hidden: true },
				{ field: "firstName", hidden: true },
				{ field: "country", hidden: true },
				{ field: "state", hidden: true },
				{ field: "city", hidden: true },
				{ field: "address", hidden: true },
				{ field: "zipCode", hidden: true },
				{ field: "mobile", hidden: true },
				{ field: "ccMail", hidden: true },
				{ field: "selfIntroduction", hidden: true },
			]],
			onBeforeLoad: function(param) {
				param.id = $("#hidContributeId").val();
				param.random = Math.random();
			},
			onLoadSuccess: function(){
				$("#authorDG").parent().find("div .datagrid-header-check").children("input[type=\"checkbox\"]").eq(0).attr("style", "display:none;");
				initAuthorForm();
			},
			onCheck: function (rowIndex, rowData) {
				editAuthor(rowData.id, rowIndex);
			},
			onUncheck: function (rowIndex, rowData) {
				initAuthorForm();
			},
		});

		$("#authorWindow").window("open");
	}

	function initAuthorForm() {
		var rows = $("#authorDG").datagrid("getRows");
		var tempSort = 1;
		for (var i = 0; i<rows.length; i++) {
			if (rows[i].sort > tempSort) {
				tempSort = rows[i].sort;
			}
		}

		$("#txtFamilyName").textbox("setValue", "");
		$("#txtFirstName").textbox("setValue", "");
		$("#txtFullName").textbox("setValue", "");

		$("#txtAddress").textbox("setValue", "");
		$("#txtZipCode").textbox("setValue", "");
		$("#txtMobile").textbox("setValue", "");
		$("#txtMail").textbox("setValue", "")
		$("#txtCcMail").textbox("setValue", "")
		$("#txtSelfIntroduction").textbox("setValue", "");
		$("#ddlStatus").combobox("setValue", "@ConstValues.Status.正常");
		//$("#txtSort").numberbox("setValue", @ConstValues.DefaultSort);
		$("#txtSort").numberbox("setValue", tempSort +1);
		$("#txtRemark").textbox("setValue", "");
		$("#hdnAuthorWindowType").val("add");

		$("#txtAffiliation0").textbox("setValue", "");
		$("#txtAffiliation1").textbox("setValue", "");
		$("#txtAffiliation2").textbox("setValue", "");
		$("#txtAffiliation3").textbox("setValue", "");
		$("#txtAffiliation4").textbox("setValue", "");
		$("#txtAffiliation5").textbox("setValue", "");
		$("#txtAffiliation6").textbox("setValue", "");
		$("#txtAffiliation7").textbox("setValue", "");
		$("#txtAffiliation8").textbox("setValue", "");
		$("#txtAffiliation9").textbox("setValue", "");

		$("#ddlCountry0").textbox("setValue", "");
		$("#ddlCountry1").textbox("setValue", "");
		$("#ddlCountry2").textbox("setValue", "");
		$("#ddlCountry3").textbox("setValue", "");
		$("#ddlCountry4").textbox("setValue", "");
		$("#ddlCountry5").textbox("setValue", "");
		$("#ddlCountry6").textbox("setValue", "");
		$("#ddlCountry7").textbox("setValue", "");
		$("#ddlCountry8").textbox("setValue", "");
		$("#ddlCountry9").textbox("setValue", "");

		$("#trAffiliation0").css("display", "");
		$("#trAffiliation1").css("display", "none");
		$("#trAffiliation2").css("display", "none");
		$("#trAffiliation3").css("display", "none");
		$("#trAffiliation4").css("display", "none");
		$("#trAffiliation5").css("display", "none");
		$("#trAffiliation6").css("display", "none");
		$("#trAffiliation7").css("display", "none");
		$("#trAffiliation8").css("display", "none");
		$("#trAffiliation9").css("display", "none");
	}

	function changeContactAuthor(id) {
		$("#hidAuthorId").val(id);
		var loading = layer.load(0,  {
			shade: [0.4,"#fff"]
		});

		$.post("@Url.Action(nameof(ProfileContributeInfoController.ChangeContactAuthor),
				nameof(ProfileContributeInfoController).GetControllerName())",
			$("#frmAuthor").serialize(),
			function(data, textStatus, jqXHR) {
				layer.close(loading);
				if (data.result == "@ConstValues.AjaxFailResult") {
					common.showError(data.message);
				} else {
					common.showSuccess(data.message, true);
					$("#authorDG").datagrid("reload");
				}
			}
		);
	}

	function changePresenter(id, obj) {
		if (obj.checked) {
			$("#hidAuthorId").val(id);
			var loading = layer.load(0,  {
				shade: [0.4,"#fff"]
			});

			$.post("@Url.Action(nameof(ProfileContributeInfoController.ChangePresenter),
					nameof(ProfileContributeInfoController).GetControllerName())",
				$("#frmAuthor").serialize(),
				function(data, textStatus, jqXHR) {
					layer.close(loading);
					if (data.result == "@ConstValues.AjaxFailResult") {
						common.showError(data.message);
					} else {
						common.showSuccess(data.message, true);
						$("#authorDG").datagrid("reload");
					}
				}
			);
		} else {
			obj.checked = true;
		}
	}

	function editAuthor(id, rowIndex) {
		$("input[name=chk]").attr("checked",false);
		$("input[type='checkbox']").eq(parseInt(rowIndex)+1).prop("checked", true);
		$("#hidAuthorId").val(id);

		var url = "@Url.Action(nameof(UtilityController.GetEditAuthor), nameof(UtilityController).GetControllerName())?id=" + id;
		$.get(url, null, function (data, textStatus, jqXHR) {
			if (data.result == "@ConstValues.AjaxFailResult") {
				common.showError(data.message);
				$("#dataGrid").datagrid("reload");
			} else {
				$("#txtFamilyName").textbox("setValue", data.data.familyName);
				$("#txtFirstName").textbox("setValue", data.data.firstName);
				$("#txtFullName").textbox("setValue", data.data.fullName);

				$("#txtAddress").textbox("setValue", data.data.address);
				$("#txtZipCode").textbox("setValue", data.data.zipCode);
				$("#txtMobile").textbox("setValue", data.data.mobile);
				$("#txtMail").textbox("setValue", data.data.mail)
				$("#txtCcMail").textbox("setValue", data.data.ccMail)
				$("#txtSelfIntroduction").textbox("setValue", data.data.selfIntroduction);
				$("#ddlStatus").combobox("setValue", data.data.status);
				$("#txtSort").numberbox("setValue", data.data.sort);
				$("#txtRemark").textbox("setValue", data.data.remark);

				$("#ddlCountry0").combobox({
					url: "@Url.Action(nameof(UtilityController.GetCountry), nameof(UtilityController).GetControllerName())",
					valueField: "id",
					textField: "name",
					required: true
				});
				$("#ddlCountry1").combobox({
					url: "@Url.Action(nameof(UtilityController.GetCountry), nameof(UtilityController).GetControllerName())",
					valueField: "id",
					textField: "name",
					required: false
				});
				$("#ddlCountry2").combobox({
					url: "@Url.Action(nameof(UtilityController.GetCountry), nameof(UtilityController).GetControllerName())",
					valueField: "id",
					textField: "name",
					required: false
				});
				$("#ddlCountry3").combobox({
					url: "@Url.Action(nameof(UtilityController.GetCountry), nameof(UtilityController).GetControllerName())",
					valueField: "id",
					textField: "name",
					required: false
				});
				$("#ddlCountry4").combobox({
					url: "@Url.Action(nameof(UtilityController.GetCountry), nameof(UtilityController).GetControllerName())",
					valueField: "id",
					textField: "name",
					required: false
				});
				$("#ddlCountry5").combobox({
					url: "@Url.Action(nameof(UtilityController.GetCountry), nameof(UtilityController).GetControllerName())",
					valueField: "id",
					textField: "name",
					required: false
				});
				$("#ddlCountry6").combobox({
					url: "@Url.Action(nameof(UtilityController.GetCountry), nameof(UtilityController).GetControllerName())",
					valueField: "id",
					textField: "name",
					required: false
				});
				$("#ddlCountry7").combobox({
					url: "@Url.Action(nameof(UtilityController.GetCountry), nameof(UtilityController).GetControllerName())",
					valueField: "id",
					textField: "name",
					required: false
				});
				$("#ddlCountry8").combobox({
					url: "@Url.Action(nameof(UtilityController.GetCountry), nameof(UtilityController).GetControllerName())",
					valueField: "id",
					textField: "name",
					required: false
				});
				$("#ddlCountry9").combobox({
					url: "@Url.Action(nameof(UtilityController.GetCountry), nameof(UtilityController).GetControllerName())",
					valueField: "id",
					textField: "name",
					required: false
				});

				$("#txtAffiliation0").textbox("setValue", data.data.affiliation0 != "" ? data.data.affiliation0 : "");
				$("#txtAffiliation1").textbox("setValue", data.data.affiliation1 != "" ? data.data.affiliation1 : "");
				$("#txtAffiliation2").textbox("setValue", data.data.affiliation2 != "" ? data.data.affiliation2 : "");
				$("#txtAffiliation3").textbox("setValue", data.data.affiliation3 != "" ? data.data.affiliation3 : "");
				$("#txtAffiliation4").textbox("setValue", data.data.affiliation4 != "" ? data.data.affiliation4 : "");
				$("#txtAffiliation5").textbox("setValue", data.data.affiliation5 != "" ? data.data.affiliation5 : "");
				$("#txtAffiliation6").textbox("setValue", data.data.affiliation6 != "" ? data.data.affiliation6 : "");
				$("#txtAffiliation7").textbox("setValue", data.data.affiliation7 != "" ? data.data.affiliation7 : "");
				$("#txtAffiliation8").textbox("setValue", data.data.affiliation8 != "" ? data.data.affiliation8 : "");
				$("#txtAffiliation9").textbox("setValue", data.data.affiliation9 != "" ? data.data.affiliation9 : "");

				$("#ddlCountry0").textbox("setValue", data.data.country0 != "" ? data.data.country0 : "");
				$("#ddlCountry1").textbox("setValue", data.data.country1 != "" ? data.data.country1 : "");
				$("#ddlCountry2").textbox("setValue", data.data.country2 != "" ? data.data.country2 : "");
				$("#ddlCountry3").textbox("setValue", data.data.country3 != "" ? data.data.country3 : "");
				$("#ddlCountry4").textbox("setValue", data.data.country4 != "" ? data.data.country4 : "");
				$("#ddlCountry5").textbox("setValue", data.data.country5 != "" ? data.data.country5 : "");
				$("#ddlCountry6").textbox("setValue", data.data.country6 != "" ? data.data.country6 : "");
				$("#ddlCountry7").textbox("setValue", data.data.country7 != "" ? data.data.country7 : "");
				$("#ddlCountry8").textbox("setValue", data.data.country8 != "" ? data.data.country8 : "");
				$("#ddlCountry9").textbox("setValue", data.data.country9 != "" ? data.data.country9 : "");

				$("#trAffiliation1").css("display", data.data.affiliation1 != "" ? "" : "none");
				$("#trAffiliation2").css("display", data.data.affiliation2 != "" ? "" : "none");
				$("#trAffiliation3").css("display", data.data.affiliation3 != "" ? "" : "none");
				$("#trAffiliation4").css("display", data.data.affiliation4 != "" ? "" : "none");
				$("#trAffiliation5").css("display", data.data.affiliation5 != "" ? "" : "none");
				$("#trAffiliation6").css("display", data.data.affiliation6 != "" ? "" : "none");
				$("#trAffiliation7").css("display", data.data.affiliation7 != "" ? "" : "none");
				$("#trAffiliation8").css("display", data.data.affiliation8 != "" ? "" : "none");
				$("#trAffiliation9").css("display", data.data.affiliation9 != "" ? "" : "none");

				$("#hdnAuthorWindowType").val("edit");
			}
		});
	}

	function addAuthor() {
		var isValid = $("#frmAuthor").form("validate");

		if (isValid) {
			$.messager.confirm("@Resources.Submit", "@Resources.CfmSave", function (r) {
				if (r) {
					var loading = layer.load(0,  {
						shade: [0.4,"#fff"]
					});
					switch ($("#hdnAuthorWindowType").val())
					{
						case "add":
							$.post("@Url.Action(nameof(ProfileContributeInfoController.CreateAuthor),
									nameof(ProfileContributeInfoController).GetControllerName())",
								$("#frmAuthor").serialize(),
								function(data, textStatus, jqXHR) {
									layer.close(loading);
									if (data.result == "@ConstValues.AjaxFailResult") {
										common.showError(data.message);
									} else {
										common.showSuccess(data.message, true);
										$("#authorDG").datagrid("load");
										initAuthorForm();
									}
								}
							);
							break;
						case "edit":
							$.post("@Url.Action(nameof(ProfileContributeInfoController.EditAuthor),
									nameof(ProfileContributeInfoController).GetControllerName())",
								$("#frmAuthor").serialize(),
								function(data, textStatus, jqXHR) {
									layer.close(loading);
									if (data.result == "@ConstValues.AjaxFailResult") {
										common.showError(data.message);
									} else {
										common.showSuccess(data.message, true);
										$("#authorDG").datagrid("load");
										initAuthorForm();
									}
								}
							);
							break;
					}
				}
			});
		}
	}

	function deleteAuthor(id, name) {
		var confirmMessage = "@Resources.CfmDelete";
		confirmMessage = confirmMessage.replace(/\{0\}/g, name);
		$.messager.confirm("@Resources.Delete", confirmMessage, function (r) {
			if (r) {
				$("#hidAuthorId").val(id);
				$.post("@Url.Action(nameof(ProfileContributeInfoController.DeleteAuthor),
						nameof(ProfileContributeInfoController).GetControllerName())",
					$("#frmAuthor").serialize(),
					function(data, textStatus, jqXHR) {
						if (data.result == "@ConstValues.AjaxFailResult") {
							common.showError(data.message);
						} else {
							common.showSuccess(data.message, true);
							$("#authorDG").datagrid("reload");
							initAuthorForm();
						}
					}
				);
			}
		});
	}

	function openAwards(id, conferenceId) {
		$("#hidAwardsConferenceId").val(conferenceId);
		$("#hidAwardsContributeId").val(id);

		$("#awardsDG").datagrid({
			url: "@Url.Action(nameof(UtilityController.GetAwardsList), nameof(UtilityController).GetControllerName())",
			method: "get",
			fitColumns: true,
			checkOnSelect: false,
			selectOnCheck: false,
			height: 532,
			nowrap: false,
			pageSize: @ConstValues.DefaultGridRows,
			striped: true,
			singleSelect: true,
			singleCheck: true,
			columns: [[
				{ field: "awardsName", title: "@Resources.AwardsName", align: "center", width: 200 },
				{ field: "awardsContent", title: "@Resources.AwardsContent", align: "center", width: 550 },
				{
					field: "link", title: "@Resources.Link", align: "center", width: 300,
					formatter: function(value, rec) {
						if (value == null) {
							return "@ConstValues.strHyphen@ConstValues.strHyphen";
						} else {
							return "<a href='" + value + "' style='color:#1874CD;text-decoration:underline;' target='_blank'>" + value + "</a>";
						}
					}
				},
				{
					field: "awardsId", title: "@Resources.ApplyOrDecline", align: "center", width: 150,
					formatter: function(value, rec) {
						var strInfo = "";
						if (value != null) {
							strInfo = "<input type='checkbox' style='margin-top:8px;' onchange='applyOrDecline(\"" + rec.id + "\")' checked/>";
						} else {
							strInfo = "<input type='checkbox' style='margin-top:8px;' onchange='applyOrDecline(\"" + rec.id + "\")' />";
						}
						return strInfo;
					}
				},
			]],
			onBeforeLoad: function(param) {
				param.conferenceId = $("#hidAwardsConferenceId").val();
				param.contributeId = $("#hidAwardsContributeId").val();
				param.userName = "@((User as ICISPrincipal).UserName)";
				param.random = Math.random();
			},
		});

		$("#awardsWindow").window("open");
	}

	function applyOrDecline(id) {
		$("#hidAwardsId").val(id);
		var loading = layer.load(0,  {
			shade: [0.4,"#fff"]
		});

		$.post("@Url.Action(nameof(ProfileContributeInfoController.ApplyOrDecline),
				nameof(ProfileContributeInfoController).GetControllerName())",
			$("#frmAwards").serialize(),
			function(data, textStatus, jqXHR) {
				layer.close(loading);
				if (data.result == "@ConstValues.AjaxFailResult") {
					common.showError(data.message);
				} else {
					common.showSuccess(data.message, true);
					$("#awardsDG").datagrid("reload");
				}
			}
		);
	}
</script>
}